<!DOCTYPE html>
<html>
<head>
  <style>
    /* Background animation */
    body {
      background: linear-gradient(45deg, #3498db, #e74c3c, #2ecc71, #f1c40f);
      background-size: 400% 400%;
      animation: gradient 15s linear infinite;
    }

    @keyframes gradient {
      0% {
        background-position: 0% 50%;
      }
      50% {
        background-position: 100% 50%;
      }
      100% {
        background-position: 0% 50%;
      }
    }

    /* Cube animation */
    .container {
      perspective: 800px;
      width: 200px;
      height: 200px;
      position: relative;
      margin: 100px auto;
      animation: rotate 10s linear infinite;
    }

    .cube {
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
    }

    .face {
      position: absolute;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid #000;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 24px;
      font-weight: bold;
    }

    .front  { transform: translateZ(100px); }
    .back   { transform: rotateY(180deg) translateZ(100px); }
    .right  { transform: rotateY(90deg) translateZ(100px); }
    .left   { transform: rotateY(-90deg) translateZ(100px); }
    .top    { transform: rotateX(90deg) translateZ(100px); }
    .bottom { transform: rotateX(-90deg) translateZ(100px); }

    @keyframes rotate {
      0% {
        transform: rotateX(0deg) rotateY(0deg);
      }
      100% {
        transform: rotateX(360deg) rotateY(360deg);
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="cube">
      <div class="face front">Front</div>
      <div class="face back">Back</div>
      <div class="face right">Right</div>
      <div class="face left">Left</div>
      <div class="face top">Top</div>
      <div class="face bottom">Bottom</div>
    </div>
  </div>
</body>
</html>
